home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / CMPLTPAS / PULL.PAS < prev    next >
Pascal/Delphi Source File  |  1988-07-14  |  440b  |  18 lines

  1. {<<<< Pull >>>>}
  2. { From: COMPLETE TURBO PASCAL 5.0 by Jeff Duntemann  }
  3. { Scott, Foresman & Co. 1988      ISBN 0-673-38355-5 }
  4. { Described in section 16.12  --  Last mod 12/5/87   }
  5.  
  6.  
  7. FUNCTION Pull(Low,High : Integer) : Integer;
  8.  
  9. VAR
  10.   I : Integer;
  11.  
  12. BEGIN
  13.   REPEAT                   { Keep requesting random integers until }
  14.     I := Random(High + 1); { one falls between Low and High }
  15.   UNTIL I >= Low;
  16.   Pull := I
  17. END;
  18.